<?PHP

	include("../../includes/configAjax.php");
	
	$variableStack['topic_id'] = $db->prep($_GET['topic_id']);
	$variableStack['board_id'] = $db->prep($_GET['board_id']);
	$variableStack['category_id'] = $db->prep($_GET['category_id']);
	$variableStack['topic_text'] = $db->prep($_GET['topic_text']);
	if($users->auth($db, 2)){
		$variableStack['stick_tag']	= "";
	} else {
		$variableStack['stick_tag']	= "_disabled";
	}
	
	/* smilies for reply */
	$smileyResult = $db->query("SELECT * FROM ".$prefix."smilies");
	
	$variableStack['smilies'] = "";
	while($smileyRow = mysql_fetch_object($smileyResult)){
		$variableStack['smilies'] .= "<img name='smiley' class='smiley' title='".$smileyRow->smiley_name."' src='images/smilies/".$smileyRow->smiley_path."' width='15' height='15' alt=\"".$smileyRow->smiley_tag."\" />";
	}						   
	
	/* bbcode for reply */
	$bbcodeResult = $db->query("SELECT * FROM ".$prefix."bbcode");
	
	$variableStack['bbcode'] = "";
	while($bbcodeRow = mysql_fetch_object($bbcodeResult)){
		$regText = str_replace("{TEXT}", "", $bbcodeRow->regex_tags);
		$variableStack['bbcode'] .= "<div class='bbcode_button' id=\"".$regText."\">".$bbcodeRow->bbcode_name."</div>";
	}						   

	/* reply controls */	
	$html = file_get_contents('../../styles/'.$activeStyle.'/t/postform.html');
	$outHtml = parseHtml($html, $variableStack);	
	
	echo $outHtml;

?>